# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the linux memory manager.
#

CFLAGS_interval_tree.o = -O2

CFLAGS_huge_memory.o = -O

KASAN_SANITIZE_slab_common.o := n
KASAN_SANITIZE_slab.o := n
KASAN_SANITIZE_slub.o := n

# These files are disabled because they produce non-interesting and/or
# flaky coverage that is not a function of syscall inputs. E.g. slab is out of
# free pages, or a task is migrated between nodes.
KCOV_INSTRUMENT_slab_common.o := n
KCOV_INSTRUMENT_slob.o := n
KCOV_INSTRUMENT_slab.o := n
KCOV_INSTRUMENT_slub.o := n
KCOV_INSTRUMENT_page_alloc.o := n
KCOV_INSTRUMENT_debug-pagealloc.o := n
KCOV_INSTRUMENT_kmemleak.o := n
KCOV_INSTRUMENT_memcontrol.o := n
KCOV_INSTRUMENT_mmzone.o := n
KCOV_INSTRUMENT_vmstat.o := n

mmu-y			:= 
mmu-$(CONFIG_MMU)	:= memory.o  \
			   vmalloc.o

obj-y			:=  \
			   page_alloc.o \
			   util.o \
			    slab_common.o \
			    $(mmu-y)

obj-y += init-mm.o
obj-y += memblock.o
obj-$(CONFIG_SLUB) += slub.o
obj-$(CONFIG_GENERIC_EARLY_IOREMAP) += early_ioremap.o
obj-$(CONFIG_CMA)	+= cma.o
